<?php
/**
 * +----------------------------------------------------------------------
 * | Author: 罗极
 * +----------------------------------------------------------------------
 * | Description: IndexController.php
 * +----------------------------------------------------------------------
 * | User: Administrator Date: 8/24/ 0024 Time: 10:41
 * +----------------------------------------------------------------------
 */

namespace Main\V1\Index\Controller;

use Framework\Controller\Abstracts\AbstractController;
use Framework\Controller\Exception\NotFoundException;
use Framework\View\HtmlView;

class IndexController extends AbstractController
{

    public function bootstrap()
    {
        echo '<br />bootstrap<br />';
    }

    public function beforeIndex()
    {
        echo '<br />before<br />';
    }

    public function indexAction()
    {
        echo $this->xss(__METHOD__);
//        throw new NotFoundException('aaaa');
//        $view = new HtmlView();
//        $view->assign('aa','aa');
//        $view->assign('bb','bb');
//        $view->assignArr([
//            'cc' => 'cc',
//            'dd' => 'dd'
//        ]);
//        $view->show();
//        return $view;
//        return 'index return';

        return new HtmlView(['a' => 'a', 'b' => 'b']);
    }

    public function afterIndex()
    {
        echo '<br />after<br />';
    }


}